using System;
using System.Collections.Generic;
using System.Text;

using IGlobalist.Cms.Model;

namespace IGlobalist.Cms.DataAccess
{
    /// <summary>
    /// Implenment BaseDAO class, IClassTypeDAO class 
    /// </summary>
    public class ClassTypeDAO : BaseDAO, IClassTypeDAO
    {
        #region IClassTypeDAO Members
        /// <summary>
        /// Get class type by Id
        /// </summary>
        /// <param name="id">Id of class type</param>
        /// <returns>ClassType</returns>
        public ICmsClassType GetClassType(short id)
        {
            return (ICmsClassType)ExecuteQueryForObject("GetClassType", id);
        }
        /// <summary>
        /// Get class type list
        /// </summary>
        /// <returns>Class type list</returns>
        public IList<ICmsClassType> GetClassTypeList()
        {
            System.Collections.IList list = ExecuteQueryForList("GetClassTypeList", null);
            IList<ICmsClassType> retList = new List<ICmsClassType>();
            if (list != null)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    retList.Add((ICmsClassType)list[i]);
                }
            }
            return retList;
        }

        #endregion
    }
}
